package com.ttl.bc.master.dwr.service;

import java.util.List;

import com.ttl.bc.master.project.BCProjectBean;
import com.ttl.bc.master.project.BCProjectDAO;



public class BCProjectService {
	
	@SuppressWarnings("unchecked")
	public BCProjectBean getProject(String id) {
		
		String hql = "FROM BCProjectBean p WHERE upper(p.code) =  '"+id.toUpperCase()+"'";
		BCProjectBean bean = new BCProjectBean("","",0.0);		
		BCProjectDAO dao = new BCProjectDAO();
		List al = dao.find(hql);
		if (al.size()>0) {
			bean = (BCProjectBean)al.get(0);								
		}				
//		System.out.println(bean.getCode()+" - "+bean.getName());
//		System.out.println("##############################");
		return bean;
	}
}
